<template>
  <div>
    <button @click="handleTest">通信测试（通过customevent方法）</button>
    <button @click="handleStore">store通信测试 {{ count }}</button>
    <router-view></router-view>
  </div>
</template>

<script setup>
import { ref } from 'vue'
function handleTest() {
  window.custom.emit('test', 'app vue3')
}

const count = ref(1)

function handleStore() {
  count.value++
  const { store } = window
  const storeData = store.getStore()
  store.update({
    ...storeData,
    name: 'xuke' + count.value
  })
}
</script>

<style lang="scss"></style>
